<?php

/**
 * This is the model class for table "t_ttd".
 *
 * The followings are the available columns in table 't_ttd':
 * @property string $NIP
 * @property string $NAMA
 * @property string $NIP2
 * @property string $JABATAN1
 * @property string $JABATAN2
 * @property string $JABATAN3
 * @property string $JABATAN4
 * @property string $PJBDJPB
 * @property integer $ID
 */
class TTtd extends CActiveRecord
{
	/**
	 * Returns the static model of the specified AR class.
	 * @param string $className active record class name.
	 * @return TTtd the static model class
	 */
	public static function model($className=__CLASS__)
	{
		return parent::model($className);
	}

	/**
	 * @return string the associated database table name
	 */
	public function tableName()
	{
		return 't_ttd';
	}

	/**
	 * @return array validation rules for model attributes.
	 */
	public function rules()
	{
		// NOTE: you should only define rules for those attributes that
		// will receive user inputs.
		return array(
			array('NIP, NAMA, NIP2, JABATAN1, JABATAN2, JABATAN3, JABATAN4', 'length', 'max'=>60),
			array('PJBDJPB', 'length', 'max'=>1),
			// The following rule is used by search().
			// Please remove those attributes that should not be searched.
			array('NIP, NAMA, NIP2, JABATAN1, JABATAN2, JABATAN3, JABATAN4, PJBDJPB, ID', 'safe', 'on'=>'search'),
		);
	}

	/**
	 * @return array relational rules.
	 */
	public function relations()
	{
		// NOTE: you may need to adjust the relation name and the related
		// class name for the relations automatically generated below.
		return array(
		);
	}

	/**
	 * @return array customized attribute labels (name=>label)
	 */
	public function attributeLabels()
	{
		return array(
			'NIP' => 'Nip',
			'NAMA' => 'Nama',
			'NIP2' => 'Nip2',
			'JABATAN1' => 'Jabatan1',
			'JABATAN2' => 'Jabatan2',
			'JABATAN3' => 'Jabatan3',
			'JABATAN4' => 'Jabatan4',
			'PJBDJPB' => 'Pjbdjpb',
			'ID' => 'ID',
		);
	}

	/**
	 * Retrieves a list of models based on the current search/filter conditions.
	 * @return CActiveDataProvider the data provider that can return the models based on the search/filter conditions.
	 */
	public function search()
	{
		// Warning: Please modify the following code to remove attributes that
		// should not be searched.

		$criteria=new CDbCriteria;

		$criteria->compare('NIP',$this->NIP,true);
		$criteria->compare('NAMA',$this->NAMA,true);
		$criteria->compare('NIP2',$this->NIP2,true);
		$criteria->compare('JABATAN1',$this->JABATAN1,true);
		$criteria->compare('JABATAN2',$this->JABATAN2,true);
		$criteria->compare('JABATAN3',$this->JABATAN3,true);
		$criteria->compare('JABATAN4',$this->JABATAN4,true);
		$criteria->compare('PJBDJPB',$this->PJBDJPB,true);
		$criteria->compare('ID',$this->ID);

		return new CActiveDataProvider($this, array(
			'criteria'=>$criteria,
		));
	}
}